package com.bdqn.zhang.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

/**
 * <Description> <br>
 *
 * @author tao<br>
 * @version 1.0<br>
 * @taskId: <br>
 * @createDate 2019/10/17 12:14 <br>
 * @see com.bdqn.zhang.pojo <br>
 */
@Entity // HQL 使用,默认类名
@Table(name="cattb") //数据库原生SQL使用,默认表名
@Data
@AllArgsConstructor
public class Cat implements Serializable {
    @Id //实体类的主键
    @GeneratedValue //自动增长列
    @OrderBy //数据加载顺序
    @Column(columnDefinition = "int unsigned NOT NULL comment '备注:猫自动增长主键' ")
    private Integer id;
    @Column(length = 20) //字符长度20
    private String name;
    @Column(columnDefinition = "char(1) comment '备注:猫姓名' ")
    private String sex;
    @Column(columnDefinition = "int unsigned DEFAULT 0 comment '备注:猫年龄' ")
    private Integer age;
    private Date birthday;
    @Column(columnDefinition = "TIMESTAMP", nullable = false, updatable = false, insertable = false)
    private Timestamp updateTime;
    @Transient //临时参数,不映射到数据库表字段
    private String catParam;

    public Cat() {
    }
}
